import QtQuick 1.0

QMLTwitterBase{
    id: _root

    //////////////////////////////////////////////////////////
    // properties


    //////////////////////////////////////////////////////////
    // changed


    //////////////////////////////////////////////////////////
    // signals

    signal responseFollowersIds(string text)
    signal responseFriendsIds(string text)

    signal responseFriendshipsCreate(string text)
    signal responseFriendshipsDestory(string text)
    signal responseFriendshipsLookup(string text)


    //////////////////////////////////////////////////////////
    // methods

    function followersIds(user_id, screen_name, cursor, stringify_ids){
        var content = {};
        if(!isNullOrEmpty(user_id)){
            content.user_id = user_id;
        }
        if(!isNullOrEmpty(screen_name)){
            content.screen_name = screen_name;
        }
        if(!isNullOrEmpty(cursor)){
            content.cursor = cursor;
        }
        if(!isNullOrEmpty(stringify_ids)){
            content.stringify_ids = stringify_ids;
        }
        requestAPI("GET", "URL_FOLLOWERS_IDS"
                   , content, responseFollowersIds);
    }
    function friendsIds(user_id, screen_name, cursor, stringify_ids){
        var content = {};
        if(!isNullOrEmpty(user_id)){
            content.user_id = user_id;
        }
        if(!isNullOrEmpty(screen_name)){
            content.screen_name = screen_name;
        }
        if(!isNullOrEmpty(cursor)){
            content.cursor = cursor;
        }
        if(!isNullOrEmpty(stringify_ids)){
            content.stringify_ids = stringify_ids;
        }
        requestAPI("GET", "URL_FRIENDS_IDS"
                   , content, responseFriendsIds);
    }
    function friendshipsExists(){

    }
    function friendshipsIncoming(){

    }
    function friendshipsOutGoing(){

    }
    function friendshipsShow(){

    }
    function friendshipsCreate(screen_name, user_id, follow){
        var content = {};
        if(!isNullOrEmpty(screen_name)){
            content.screen_name = screen_name;
        }
        if(!isNullOrEmpty(user_id)){
            content.user_id = user_id;
        }
        if(!isNullOrEmpty(follow)){
            content.follow = follow;
        }
        requestAPI("POST", "URL_FRIENDSHIPS_CREATE"
                   , content, responseFriendshipsCreate);
    }

    function friendshipsDestory(screen_name, user_id, include_entities){
        var content = {};
        if(!isNullOrEmpty(screen_name)){
            content.screen_name = screen_name;
        }
        if(!isNullOrEmpty(user_id)){
            content.user_id = user_id;
        }
        if(!isNullOrEmpty(include_entities)){
            content.include_entities = include_entities;
        }
        requestAPI("POST", "URL_FRIENDSHIPS_DESTROY"
                   , content, responseFriendshipsDestory);
    }

    function friendshipsLookup(screen_name, user_id, on_func){
        var content = {};
        if(!isNullOrEmpty(screen_name)){
            content.screen_name = screen_name;
        }
        if(!isNullOrEmpty(user_id)){
            content.user_id = user_id;
        }
        if(!isNullOrEmpty(on_func)){
        }else{
            on_func = responseFavorites;
        }
        requestAPI("GET", "URL_FRIENDSHIPS_LOOKUP"
                   , content, on_func);
    }
    function friendshipsUpdate(){

    }
    function friendshipsNoRetweetIds(){

    }
}
